package com.tedu.mybatis.mapper;

import com.tedu.mybatis.pojo.*;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface WeiboMapper {
//    @Insert("INSERT INTO weibo(content,created,user_id)"+
//            "VALUES (#{content},#{created},#{userId})")
    int insert(Weibo weibo);

//    @Delete("DELETE FROM weibo WHERE id=#{id}")
    int deleteById(Integer id);

//    @Update("UPDATE weibo " +
//            "SET content=#{content},created=#{created},user_id=#{userId} " +
//            "WHERE id=#{id}")
    int updateById(Weibo weibo);

//    @Select("SELECT id,content,created,user_id userId "+
//            "FROM weibo "+
//            "WHERE id=#{id}")
    Weibo selectById(Integer id);

//    @Select("SELECT id,content,created,user_id userId "+
//            "FROM weibo ")
    List<Weibo> selectAll();

//    @Select("SELECT content,created "+
//            "FROM weibo")
    List<WeiboVO1> selectAllWeiboVO1();

//    @Select("SELECT content,user_id userId "+
//            "FROM weibo "+
//            "WHERE id=#{id}")
    WeiboVO2 selectWeiboVO2ById(Integer id);

    int dynamicDeleteByIds(Integer[] ids);

    int dynamicDeleteByIds2(List<Integer> ids);

    WeiboVO3 selectResultMap(Integer id);

    WeiboVO4 selectweiboAndComment(Integer id);

    int countWeibo();
}
